<template>
	<view class="index">
		<!-- <statusbar></statusbar>
		<view class="header" :style="{paddingRight:paddingright==0?'32rpx':paddingright}">
			<view class="left">
				<u-search placeholder="搜索关键字" v-model="keyword" :showAction='false'></u-search>
			</view>
		</view> -->
		<u-navbar>
			<view class="u-nav-slot" slot="left" :style="{width:`calc(750rpx - 52rpx - ${paddingright})`}">
				<view class="left">
					<u-search placeholder="搜索关键字" v-model="keyword" :disabled="true" @click='clickto("/pages/message/sousuo")' :showAction='false'></u-search>
				</view>
			</view>
		</u-navbar>
		<view :style="{paddingTop:marginTop+'px'}">
			<view
				class="mesBox"
				v-for="(item,index) in messageList"
				:key="index"
				@click="clickItem(index)"
			>
				<view class="msg-top">
					<view class="name">
						<view class="touxiang"></view>
						<text>{{item.name}}</text>
					</view>
					<text class="date">{{item.date}}</text>
				</view>
				<view class="msg-title">
					<view class="tag">#{{item.titleTag}}#</view>
					<view class="title">{{item.title}}</view>
				</view>
				<view class="msg-msg">{{item.message}}</view>
				<view class="msg-img">
					<view class="box"></view>
					<view class="box"></view>
					<view class="box"></view>
				</view>
				<navigator url="../message/letter">
					<view class="msg-bottom">
						<input class="bottom-left" type="text" placeholder="发布评论..." />
						<view class="bottom-right" ><img src="@/static/img/message/liaotian.png" alt="">
							<text>1</text>
						</view>
					</view>
				</navigator>
			</view>
		</view>
		<navigator url="../message/leixing">
			<img class="sends" src="@/static/img/message/send.png" alt="">
		</navigator>
	</view>
</template>

<script>
import store from '../../store';
	let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
	export default {
		data() {
			return {
				paddingright: 0,
				keyword: '',
				messageList:[],
				marginTop: 0,
			}
		},
		onLoad() {
			// #ifdef MP
			this.paddingright = `calc(750rpx - ${menuButtonInfo.left}px + 32rpx)`
			// console.log(this.paddingright)
			// #endif
			this.marginTop = 44 + uni.getStorageSync('statusBarHeight')
			this.messageList = store.state.messageList
		},
		methods: {
			clicktab(id,index){
				this.curi=index
				this.getProductCategory(id)
			},
			clickto(url){
				uni.navigateTo({
					url
				})
			},
			clickItem(index){
				uni.navigateTo({
					url:"/pages/message/datails?index="+index
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	page {
		background-color: #F2F2F2;
		height: 100%;
		font-weight: 500;
	}
	.index{
		background-color: #FFFFFF;
		.u-nav-slot {
			display: flex;
			align-items: center;
			width: calc(750rpx - 52rpx);
			.left {
				width: 100%;
			}
		}
		// .header {
		// 	// height: 158rpx;
		// 	background-color: #fff;
		// 	padding:0 30rpx 0 30rpx;
		// 	height: 125rpx;
		// 	display: flex;
		// 	justify-content: space-between;
		// 	align-items: center;
		
		// 	.left {
		// 		color: #333333;
		// 		font-size: 27rpx;
		// 		flex: 1;
		// 	}
		
		// 	.right {
		// 		display: flex;
		// 		align-items: center;
		// 		margin-left: 26rpx;
		// 		.sousuo_icon {
		// 			width: 34rpx;
		// 			height: 36rpx;
		// 			margin-left: 35rpx;
		// 		}
		// 	}
		// }
		.mesBox{
			border-bottom: #F9F9F9 solid 3rpx;
			
			.msg-top{
				margin-left: 37rpx;
				margin-right: 31rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-top: 23rpx;
				font-size: 30rpx;
				.name{
					display: flex;
					justify-content: space-between;
					align-items: center;
					.touxiang{
						width: 56rpx;
						height: 56rpx;
						background-color: #FF7D12;
						border-radius: 180rpx;
					}
					text{
						padding: 15rpx;
					}
				}
				.date{
					font-size: 26rpx;
					line-height: 36rpx;
					font-weight: 500;
					color: #949492;
				}
			}
			.msg-title{
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-top: 25rpx;
				margin-bottom: 28rpx;
				font-size: 32rpx;
				.tag{
					color:#FF7D12 ;
					font-size: 32rpx;
					background-color: #FFE5D4;
					margin-left: 37rpx;
					padding: 17rpx 17rpx 20rpx 21rpx;
					border-radius: 10rpx;
				}
				.title{
					font-size: 32rpx;
					line-height: 45rpx;
					margin-right: 29rpx;
				}
			}
			.msg-msg{
				font-size: 30rpx;
				line-height: 45rpx;
				margin-left: 37rpx;
				
			}
			.msg-img{
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin:25rpx 30rpx 36rpx 31rpx ;
				.box{
					width: 220rpx;
					height: 220rpx;
					background-color: blue;
					border-radius: 15rpx;
				}
			}
			.msg-bottom{
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-bottom: 28rpx;
				margin-left: 26rpx;
				margin-right: 30rpx;
				.bottom-left{
					background-color: #F9F9F9;
					border-radius: 31rpx;
					padding-left: 43rpx;
					width: 623rpx;
					height: 63rpx;
					font-size: 28rpx;
					line-height: 45rpx;
				}
				.bottom-right{
					
					margin-left: 19rpx;
					
					font-size: 24rpx;
					line-height: 36rpx;
					color: #949492;
					display: flex;
					justify-content: space-between;
					align-items: center;
					img{
						width: 30rpx;
						height: 28rpx;
					}
					text{
						margin-left: 4rpx;
					}
					
					
				}
			}
			
		}
		.sends{
			width: 170rpx;
			height:150rpx;
			position: fixed;
			right: 0;
			bottom:30rpx;
		}
	}
</style>

